package com.myapp.mobilesafe.activity;

import android.net.TrafficStats;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class TrafficStatsActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_flus_status);
        String totalRxBytes = "总下载流量:" + TrafficStats.getTotalRxBytes();// wifi+3g
        String totalTxBytes = "总上传流量:" + TrafficStats.getTotalTxBytes();// wifi+3g

        String mobileRxBytes = "移动下载流量" + TrafficStats.getMobileRxBytes();// 3g下载流量
        String mobileTxBytes = "移动上传流量" + TrafficStats.getMobileTxBytes();// 3g下载流量
    }
}
